<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateZansTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('zans', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('user_id')->default('0')->comment('用户表外键');
            $table->bigInteger('post_id')->default('0')->comment('文章表外键');
            $table->integer('created_at')->default('0')->comment('点赞时间');
            $table->integer('updated_at')->default('0')->comment('修改时间');
            $table->index('user_id');
            $table->index('post_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('zans');
    }
}
